home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Utilities / Cron ƒ / crontab < prev    next >
Encoding:
Text File  |  1992-10-01  |  6.5 KB  |  179 lines  |  [TEXT/Rich]

  1.  
  2.  
  3.  
  4.  
  5. //    Here's an example crontab file, based on one I’ve found useful 
  6. //    on the Mac in my office.
  7. //    
  8. //    Note that all the commands used in this crontab file have been 
  9. //    copied, or aliased, into cron's directory in order to save me 
  10. //    the trouble of providing pathnames to the commands.
  11. //    
  12. //    
  13. //    QuickRef: The fields of a crontab entry specify the following:
  14. //
  15. //    Field    Meaning
  16. //    -----    ------------------------------------------------------
  17. //      1        Minute (0-59)
  18. //      2        Hour (0-23)
  19. //      3        Day of the month (1-31)
  20. //      4        Month of the year (1-12)
  21. //      5        Day of the week (1-7, with 1=Monday)
  22. //      6        User name (unused)
  23. //      7+    Command name and arguments (if command is preceded by 
  24. //            "-b" cron executes it in the background).
  25.  
  26.  
  27.  
  28.  
  29. //    Get the correct date & time from one of several TCP-based Time 
  30. //    Protocol servers on the network. Do this at 3:00 every morning. 
  31. //    Note that MacTCP is required, and the Map control panel must be 
  32. //    set to the correct local time zone for this to work properly.
  33. //    
  34. //    Remember to use the -d option if you live in a part of the USA
  35. //    that conforms to the Daylight Savings Time (DST) convention.
  36. //    
  37. //    We select 3:00 AM because the change to/from DST occurs at 2:00 AM, 
  38. //    and waiting a further hour guarantees that the change will be 
  39. //    caught in a (relatively) timely manner even if the Mac's clock is 
  40. //    running as much as an hour fast. Of course, you could just call the 
  41. //    server a lot more often, but it seems kind of pointless.
  42.  
  43. 0 3 * * * nobody -b "tcp time client" -d hermes.chpc.utexas.edu apple.com nic.ddn.mil
  44.  
  45.  
  46.  
  47.  
  48. //    Run the activity-report program every fifteen minutes during the
  49. //    work day to help me keep track of what the heck I do.
  50.  
  51. 0,15,30,45 9-17 * * 1-5 nobody activity-report -t 240 -p "Nobody expects the Spanish Inquisition! Your confession:" -l "Chris’ Activity Log.txt" -w "Spanish Inquisition"
  52.  
  53.  
  54.  
  55.  
  56. //    Remind me of important events during the week.
  57.  
  58. 00 17 * * 1-4 nobody -b echo -t 120 "It’s 5 o’clock and time go home now, Chris."
  59. 45 11 * *   5 nobody -b echo -t 120 "Yipes! Time for Texadelphia! Get out immediately or you won't get a table!"
  60. 00 17 * *   5 nobody -b echo -t 120 "Good news! It’s 5 o’clock on Friday afternoon! Go drink some beers, Chris."
  61. 00 09 * *   2 nobody -b echo -t 120 "It’s 9 o’clock and time, sadly, to take the consulting phone."
  62. 45 11 * *   2 nobody -b echo -t 120 "It’s 11:45 and time to unforward the consulting phone."
  63. 45 16 * *   2 nobody -b echo -t 120 "Chris! It’s Beans day! Time to run away...."
  64.  
  65.  
  66.  
  67.  
  68. //    Run a screen saver after four minutes of idle time, or when 
  69. //    the mouse is in the top-right corner of the screen, but never 
  70. //    when it’s in the bottom-right corner.  (Corners are 32x32 
  71. //    squares.)
  72. //    
  73. //    This set of commands causes the "cron fader" screen saver to 
  74. //    be used from 8 AM to 5:59 PM on weekdays.  The "Midnight Sky 
  75. //    Fader" is used all the rest of the time.
  76.  
  77. idlescreen 4 2 4 : * 8-16 * * 1-5 nobody "cron fader"
  78. idlescreen 4 2 4 : * 0-7 * * 1-5 nobody "Midnight Sky Fader"
  79. idlescreen 4 2 4 : * 17-23 * * 1-5 nobody "Midnight Sky Fader"
  80. idlescreen 4 2 4 : * * * * 6,7 nobody "Midnight Sky Fader"
  81.  
  82. //    Here's where we change-over from one screen saver to another.  
  83. //    We force the switch to "cron fader" at 8:00 AM on weekdays, 
  84. //    and the change to "Midnight Sky Fader" at 6:00 PM on weekdays.
  85.  
  86. idlescreen 4-* 2 4 : 0 8 * * 1-5 nobody "cron fader"
  87. idlescreen 4-* 2 4 : 0 17 * * 1-5 nobody "Midnight Sky Fader"
  88.  
  89.  
  90.  
  91.  
  92. //    The following lines run the Eudora mailer for me -- it's run 
  93. //    just before I get in the office in the morning (8:40 AM) and 
  94. //    afternoon (12:40 PM) so my mail will be waiting for me, and 
  95. //    at 3 AM so there won't be too much waiting to be downloaded 
  96. //    in the morning.
  97.  
  98. 40 8 * * 1,2,4,5 nobody -b open -bc CSOm
  99. 40 12 * * 1-5 nobody -b open -bc CSOm
  100. 0 3 * * * nobody -b open -bc CSOm
  101.  
  102. //    This last line quits Eudora in an orderly fashion just before 
  103. //    the scheduled system shutdown. This gives Eudora (and, more to
  104. //    the point, our sometimes finicky pop server) some extra time
  105. //    to clean up.
  106.  
  107. 50 3 * * * nobody -b quit -c CSOm
  108.  
  109.  
  110.  
  111.  
  112. //    Open Nuntius newsreader at 3:30 AM every morning so that it can
  113. //    check for new groups.  That's all this does.  Maybe this will
  114. //    keep it from missing new groups when they're created; maybe not.
  115. //    Anyway, it won't hurt.
  116.  
  117. 30 3 * * * nobody -b open -c nNNn
  118.  
  119.  
  120.  
  121.  
  122. //    The following lines attempt to reboot my Mac at approximately 
  123. //    4 AM every morning, so that it can start the day fresh.  The 
  124. //    redundant shutdown calls will have no effect unless someone in 
  125. //    the office using my Mac has cancelled one of the previous calls.  
  126. //    Since all these shutdown calls use the -i (interactive) option, 
  127. //    the user can conceivably cancel them all and go on working 
  128. //    uninterrupted, but, hopefully, they’ll get the idea....
  129. //    
  130. //    Note that the "Shutdown Announcement" sound file is in the same 
  131. //    directory as the sound command, so a pathname for the sound file 
  132. //    is unnecessary.
  133. //    
  134. //    The -d option forces the desktops on all mounted volumes (where 
  135. //    applicable) to be deleted, which causes the Finder to rebuild 
  136. //    them when the system comes back up.
  137.  
  138. 50 3 * * * nobody -b sound "Shutdown Announcement"
  139.  
  140. 50 3 * * * nobody shutdown -ird 600 "Please prepare for the nightly system restart…"
  141. 55 3 * * * nobody shutdown -ird 300 "Please prepare for the nightly system restart…"
  142. 58 3 * * * nobody shutdown -ird 120 "Please prepare for the nightly system restart…"
  143. 59 3 * * * nobody shutdown -ird 60 "Please prepare for the nightly system restart…"
  144.  
  145.  
  146.  
  147.  
  148. //    The following lines mount all the volumes of our office file 
  149. //    server.  Because executables can’t be relaunched (and the mountafp 
  150. //    command currently performs only one mount at a time) we have to 
  151. //    make these calls sequentially.  (The passwords have been changed 
  152. //    to protect the innocent.)
  153.  
  154. 8 4 * * * nobody -b mountafp CC.Taylor "UT Micro Services" "UT Microservices" username password
  155. 9 4 * * * nobody -b mountafp CC.Taylor "UT Micro Services" tmp username password
  156.  
  157. //    Now that the file servers are mounted, we’ll disinfect all mounted 
  158. //    volumes.  Note that this only works with Disinfectant 3.x which 
  159. //    hasn’t been released yet, so this won't do you any good.  :-(
  160.  
  161. 0 4 * * * nobody -b disinfect -a
  162.  
  163. //    By this time (7:00 AM), the disinfection is always complete, so 
  164. //    we’ll unmount all the file server volumes.
  165.  
  166. 0 7 * * * nobody -b unmount "UT Microservices" tmp
  167.  
  168.  
  169.  
  170.  
  171. //    Run Dave Platt's uupc 3.x twice early in the morning (at 1:17 AM 
  172. //    and 6:17 AM) so it can connect with the ut-emx host.
  173.  
  174. 17 1,6 * * * nobody -b uupc -bq ut-emx
  175.  
  176.  
  177.  
  178.  
  179.